import re

from common import hlog


def classification_level(edu):
    hlog.enter_func("classification_level()")

    level_map = {
        "不限": 0,
        "初中": 1,
        "高中": 2,
        "中专": 3,
        "大专": 4,
        "本科": 5,
        "硕士": 6,
        "博士": 7
    }

    level = 0
    for key, value in level_map.items():
        if re.search(key, edu):
            level = value

    hlog.exit_func("classification_level()")

    return level
